/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Common;

import java.io.Serializable;
import java.util.Objects;

/**
 *
 * @author Lab-214-21
 */
public class Comunication implements Serializable  {
    
    private String sender;
    private String receiver;

    public Comunication() {
    }
    
    

    public Comunication(String sender, String receiver) {
        this.sender = sender;
        this.receiver = receiver;
    }
    
    @Override
    public String toString()
    {
        return "sender: "+sender+", receiver: "+receiver;
    }
    
    public String getComunicationHeaders() {
        return "\n"  +
               "------------------------------------------------" +
               "\n"  + 
               "De: " + sender +
               "\n"  + 
               "De: " + receiver +
               "\n"; 
    }   

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 37 * hash + Objects.hashCode(this.sender);
        hash = 37 * hash + Objects.hashCode(this.receiver);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Comunication other = (Comunication) obj;
        if (!Objects.equals(this.sender, other.sender)) {
            return false;
        }
        if (!Objects.equals(this.receiver, other.receiver)) {
            return false;
        }
        return true;
    }
    
}
